import { Tools } from 'weaver-mobile';
import { catchApiError } from '../util/index';
import { PARAMS } from '../components/public/BlogUtils';

// 当前用户信息
export const getCurrentUserInfo = params => {
	let options = {
		method: 'GET',
		url: '/api/blog/base/getCurrentUserInfo',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}

// 默认分享--
export const getDefaultShareList = params => {
  return Tools.callApi({
      url: '/api/blog/shareset/getBlogShareSetListDefaultCondition',
      method: 'GET',
      params: {...PARAMS, ...params}
  });
};

// 我的分享
export const getMyShareList = params => {
  return Tools.callApi({
      url: '/api/blog/shareset/getBlogShareSetListCondition',
      method: 'GET',
      params: {...PARAMS, ...params}
  });
};


// 我的分享
export const addShareSet = params => {
  return Tools.callApi({
      url: '/api/blog/shareset/operateBlogShareSet',
      method: 'GET',
      params: {...PARAMS, ...params}
  });
};

// 基本设置信息保存
export const saveBaseSetting = params => {
  return Tools.callApi({
      url: '/api/blog/setting/saveBlogUserSetting',
      method: 'POST',
      params: {...PARAMS, ...params}
  });
};
